home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Whiteline: delta
/
whiteline CD Series - delta.iso
/
fonts
/
ghost333
/
ps
/
gs_cidfn.ps
< prev
next >
Wrap
Text File
|
1995-11-25
|
4KB
|
114 lines
% Copyright (C) 1995 Aladdin Enterprises. All rights reserved.
%
% This file is part of Aladdin Ghostscript.
%
% Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
% or distributor accepts any responsibility for the consequences of using it,
% or for whether it serves any particular purpose or works at all, unless he
% or she says so in writing. Refer to the Aladdin Ghostscript Free Public
% License (the "License") for full details.
%
% Every copy of Aladdin Ghostscript must include a copy of the License,
% normally in a plain ASCII text file named PUBLIC. The License grants you
% the right to copy, modify and redistribute Aladdin Ghostscript, but only
% under certain conditions described in the License. Among other things, the
% License requires that the copyright notice and this notice be preserved on
% all copies.
% ProcSet for implementing CID-keyed fonts.
% When this is run, systemdict is still writable.
%**************** This file isn't even close to being usable.
%**************** It has never been tested, and it has no support for CMaps.
%**************** Don't even think of trying to actually use it.
/.setlanguagelevel where { pop 2 .setlanguagelevel } if
.currentglobal true .setglobal
/GS_CIDFont_ProcSet 2 dict dup begin
/StartData % <cidfontdict> <(Binary)|(Hex)> <datalength>
% StartData -
{ 2 index begin % CID font dict
20 dict begin % temporary dict
/datalength exch def
(Hex) eq /hex exch def
/cidfont exch def
/startdata currentfile fileposition def
% Read the character data into an array of strings.
% There's no particular reason to prefer long strings over short,
% so we just create a separate string for each character.
/charstrings CIDCount array def
/fontindices FDArray length FDBytes 1 eq { string } { array } ifelse def
0 1 CIDCount 1 sub
{ /cid exch def
currentfile FDBytes GDBytes add cid mul startdata add setfileposition
fontindices cid FDBytes readint put
/pos GDBytes readint def
FDBytes readint pop % skip FD of next entry
GDBytes readint pos sub
dup 0 eq
{ pop null }
{ currentfile pos setfileposition string readstring pop }
ifelse
charstrings cid 3 -1 roll put
}
for
% Process each font in the FDArray.
% For Type 3 fonts, just do a definefont with an empty Encoding.
% For Type 1 fonts, read the Subrs (don't bother to check for
% duplicates), and set CharStrings to the character data array.
% We don't support embedded Type 0 fonts, but it isn't clear
% whether they're allowed anyway.
cidfont /Encoding [ FDArray
{ dup /FontType get 1 eq
{ dup /CharStrings charstrings put
/Private get
dup /SubrCount known
{ begin /Subrs [ % Private
0 1 SubrCount 1 sub
{ SDBytes mul SubrMapOffset add startdata add
currentfile exch setfileposition
/pos SDBytes readint def
SDBytes readint pos sub
currentfile pos setfileposition string readstring pop
}
] readonly def end % Private
}
if pop
}
if
dup /Encoding [] put
dup /FontName get exch definefont
}
forall ] readonly def
% Install the rest of the data in the font.
cidfont /FontType 0 put % ???
cidfont /CharStrings charstrings readonly put
cidfont /FontIndices fontindices readonly put
FontName cidfont /CIDFont defineresource pop
% Wrap up.
end % temporary dict
end % CID font dict
end % resource dict
} bind def
/readint % <nbytes> readint <int>
{ 0 exch { 8 bitshift currentfile read pop add } repeat
} bind def
end readonly def
/defineresource where
{ pop /CIDFont GS_CIDFont_ProcSet /ProcSet defineresource pop }
if
.setglobal